﻿/*
 * LdSearchRequest
 * 
 * initial implementation : 26.6.2013
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see cz.uhul.DSMLv2.txt
 */
using System;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;


namespace cz.uhul.DSMLv2
{





  /// <summary>
  /// The LdSearchRequest class searches an entries in the directory
  /// by given filter
  /// </summary>
  //[XmlType(TypeName = "searchRequest")]
  public class LdSearchRequest : LdDnRequest
  {



    public LdSearchRequest()
      : base()
    {
      Attributes = new LdAttrNameCollection();
    }




    /// <summary>
    /// LdSearchRequest.Scope property contains one of the values
    /// of LdSearchScopeEnum that specifies the scope of the search.
    /// </summary>
    [XmlAttribute(AttributeName = "scope", Form = XmlSchemaForm.None)]
    public LdSearchScopeEnum Scope { get; set; }





    /// <summary>
    /// The LdSearchRequest.Aliases property contains one of the values of
    /// LdDereferenceAliasEnum that specifies the dereference alias behavior.
    /// </summary>
    [XmlAttribute(AttributeName = "derefAliases", Form = XmlSchemaForm.None)]
    public LdDerefAliasesEnum DerefAliases { get; set; }





    /// <summary>
    /// The LDSearchRequest.SizeLimit property contains the
    /// maximum number of objects returned in the search request.
    /// </summary>
    [XmlAttribute(AttributeName = "sizeLimit", Form = XmlSchemaForm.None)]
    public int SizeLimit { get; set; }





    /// <summary>
    /// The LdSearchRequest.TypesOnly property specifies whether the search 
    /// returns only the attribute names and not the attribute values.
    /// </summary>
    [XmlAttribute(AttributeName = "typesOnly", Form = XmlSchemaForm.None)]
    public bool TypesOnly { get; set; }





    /// <summary>
    /// The LDSearchRequest.Filter property contains the search filter. 
    /// </summary>
    [XmlElement(ElementName = "filter", Order = 1, Form = XmlSchemaForm.None, IsNullable = true)]
    public FilterGroup Filter { get; set; }





    /// <summary>
    /// The LDSearchRequest.Attributes property contains the attributes of the requested object. 
    /// </summary>
    [XmlArray(ElementName = "attributes", Order = 2, Form = XmlSchemaForm.None, IsNullable = false)]
    public LdAttrNameCollection Attributes { get; set; }
  }

}